package com.choupin.choupin.admin.entity;

import com.choupin.choupin.controller.BaseController;
import com.choupin.choupin.entity.BaseEntity;

import java.util.Objects;

public class Authentication extends BaseEntity {
    private Integer id;// 认证码表id
    private String code;// 认证码
    private Integer isUse;// 是否使用，0代表未使用，1代表已使用

    public Authentication() {
    }

    public Authentication(Integer id, String code, Integer isUse) {
        this.id = id;
        this.code = code;
        this.isUse = isUse;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getIsUse() {
        return isUse;
    }

    public void setIsUse(Integer isUse) {
        this.isUse = isUse;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Authentication that = (Authentication) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(code, that.code) &&
                Objects.equals(isUse, that.isUse);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, code, isUse);
    }

    @Override
    public String toString() {
        return "Authentication{" +
                "id=" + id +
                ", code='" + code + '\'' +
                ", isUse=" + isUse +
                '}';
    }
}
